import { Component } from '@angular/core';
import {Config, NavController, NavParams} from 'ionic-angular';
import {SubPage} from "../../common/subPage";
import {BankCardAddPage} from "../bank-card-add/bank-card-add";
import {UserProvider} from "../../providers/user/user";

@Component({
  selector: 'page-bank-card',
  templateUrl: 'bank-card.html',
})
export class BankCardPage extends SubPage{

  bankCardAddPage:any
  bankCardList: object[] = []

  constructor(public navCtrl: NavController,
              public config: Config,
              private userProvider: UserProvider,
              public navParams: NavParams) {
    super(config)
    this.bankCardAddPage = BankCardAddPage
  }

  //获取银行卡列表
  getList(){
    this.userProvider.getBankList({
      success:(d)=>{
        this.bankCardList = d.list
      }
    })
  }

  viewWillEnter(){
    this.getList()
  }

}
